-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tasks and more II #244
Merged
Capital-Asterisk
merged 35 commits into
TheOpenSpaceProgram:master
from
Capital-Asterisk:pipeline-tasks
Aug 28, 2023
Merged
Tasks and more II #244
Capital-Asterisk
merged 35 commits into
TheOpenSpaceProgram:master
from
Capital-Asterisk:pipeline-tasks
Aug 28, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capital-Asterisk
force-pushed
the
pipeline-tasks
branch
from
August 28, 2023 03:33
b2aa7e7
to
8a0960c
Compare
Capital-Asterisk
force-pushed
the
pipeline-tasks
branch
from
August 28, 2023 04:58
8a0960c
to
c175994
Compare
Capital-Asterisk
merged commit Aug 28, 2023
998caac
into
TheOpenSpaceProgram:master
22 checks passed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this took a while. If I remember correctly, trying to smash together some of the new universe stuff caused the duct tape to fall off of the tagged task system, so a new one was needed.
New task system:
Example:
before:
translation: Task triggered when scene event is called
tgSceneEvt
. ThetgSpawnReq
tag means that there are other tasks with tags liketgSpawnMod
that must be done before running this task. Similar thing with the other tags.The wrap_args function adapts the lambda's function signature to accept an array of 'any' containers as arguments, since all application data (named TopData) is stored as one big vector of 'any's. idBasic, idActiveIds, ... are indices to the vector of 'any's.
Tags have dependencies on each other; assigning these can get confusing, especially if loops are involved. Dependencies on loops just don't work. There's also the problem of 'optional branches' or conditions of when tasks are able to run that makes things more confusing. There's also quite a bit of ugly linear-search stuff in there that are not particularly fast.
after:
translation: This task runs when the
spawnRequest
pipeline is on the UseOrRun stage. Task must run oncespawnedEnts
is on its UseOrRun stage,hierarchy
is on its New stage, andtransform
is on its New stage.Each 'Pipeline' is a sequence of 'Stages' that are each run one-by-one. Tasks are set to run when a pipeline reaches a certain stage, and can be 'synchronized' to block and only run when other pipelines reach a certain stage. Pipelines can only advance to the next stage when all the tasks running on them are done, and all tasks synchronized with them are done too.
Pipelines can be parented to each other, forming a tree of pipelines. This allows supporting things like having a loop, where pipelines within the loop can sync with each other, and also properly handle cases of these pipelines depending on things outside of the 'loop scope' and vise versa. This gets confusing but the new system is capable of handling it.
Pipeline stages are defined as enums:
The pipeline stuff is similar to having mutexes and threads. One problem with mutexes, is that there's no way to know if a function is going to get blocked by a locked mutex without running the function, leading to a large number of blocked threads. Storing the 'blocking information' externally as pipelines/stages/tasks means that some executor code can very effectively coordinate which tasks can run in parallel using a fixed number of threads. It's also possible to analyze critical paths within the graph of pipelines/stages/tasks and assign priorities to tasks.
Other stuff
again, it's probably not worth trying to review the whole thing (or any at all). since...